package org.orz.story.works.biz.clubhouse.jobs;


import org.orz.story.works.biz.clubhouse.service.NbaScheduleService;
import org.orz.story.works.biz.clubhouse.service.WorksWcSchedulesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@ConditionalOnProperty(value = "schedule.enable", havingValue = "true")
@Configuration
@EnableScheduling
public class ClubHouseJobs {
    @Autowired
    private WorksWcSchedulesService worksWcSchedulesService;
    @Autowired
    private NbaScheduleService nbaScheduleService;

//    @Scheduled(cron = "0 0 * * * ?")
    private void downloadWorldCupScheduleJob(){
        worksWcSchedulesService.downloadWorldCupScheduleJob();
    }

    @Scheduled(cron = "0 0,30 0-14 * * ? ")
    private void downloadNbaScheduleJob(){
        nbaScheduleService.downloadNbaScheduleJob();
    }
}
